home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / Clouseau libs / Engines.lib < prev    next >
Encoding:
Text File  |  1998-03-19  |  52.5 KB  |  1,501 lines  |  [TEXT/MPS ]

  1. #########################################################################
  2. #########################################################################
  3. ##                     Copyright © Apple Computer, Inc. 1992-1997
  4. ##                                All rights reserved
  5. #########################################################################
  6. #########################################################################
  7. #    
  8. #    Library:        Engines.lib
  9. #    
  10. #    Version:        2.1.4
  11. #    
  12. #    Description:    Engines that will perform many common test case types
  13. #    
  14. #    Contains:
  15. #        CheckWindowLoc()
  16. #        CheckHelpBalloons()
  17. #        CheckIcons()
  18. #        CheckActions()
  19. #        CheckRadioButtons()
  20. #        CheckOpenCloseCDEV()
  21. #        CheckArea()
  22. #        xxx()
  23. #        xxx()
  24. #        xxx()
  25. #    
  26. #    History:
  27. #        Date:        By:        Changes:
  28. #        09/27/96    SBR/MSO    Updated copyright header
  29. #                            Use SPEC exception handling method (ExceptionHandling.lib)
  30. #        01/21/97    SBR        Deleted older exception code and comments.
  31. #    
  32. #########################################################################
  33. #########################################################################
  34.  
  35. Libraries 
  36.     "Additions.lib", 
  37.     "Clouseau.lib", 
  38.     "Report.lib", 
  39.     "TargetControl.lib",
  40.     "VUAid.lib",
  41.     
  42.     "TCS.lib",                             # to report Phoenix test cases
  43.     "ExceptionHandling.lib";
  44.  
  45.  
  46. #########################################################################
  47. #    task            CheckWindowLoc(testType, testList, CDEVName )
  48. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  49. #    Description:    Performs Close/Reopen tests on the named CDEV
  50. #    Parameters:        CDEVName:    name of CDEV to open and test
  51. #                    testList:=    {test1, test2, ... testN}
  52. #                        testN: { testType, TCSID, nameOfTest, CDEVWindowLoc_list, closeMethod}
  53. #                            testType:    1 = QuickLook, 2 = Functional, 3 = Comprehensive
  54. #                            TCSID:     { Number (int), Set (str), Type (str), Owner (str) }
  55. #                            nameOfTest: short test description (TCSDescription)
  56. #                            CDEVWindowLoc_list: where to drag the window before closing
  57. #                            closeMethod: how to close the window, default is cmd-w
  58. #    Returns:        Nothing
  59. #    Examples:        sampletest:= {
  60. #                        { 1, "at center top", {screenRect[3]/3, 25}
  61. #                        { 1, {1,'WindowLoc','Functional','HLQ'},"at center top", 
  62. #                {(screenRect[3]/2) - ((originalLocation[3] - originalLocation[1])/2),25}, "box"},
  63. #                    };
  64. #                    CheckWindowLoc(3, sampletest, 'Sound');
  65. #    Assumptions:    Note in defining testList that the close box must be visible for
  66. #                    the "box" option to work properly.
  67. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  68. #    History:
  69. #    3/19/92        Jon Marsh    Created
  70. #    10/04/93    Jay Loucks    Added second attempt to move window if first
  71. #                            attempt fails
  72. #    06/21/94    SBR            Mods for TCS.lib; added comments for TestN;
  73. #    09/27/96    BRL/MSO        Added SPEC exception handling
  74. #########################################################################
  75. task    CheckWindowLoc(testType:= 1, testList := {}, CDEVname:= 'NoNameDefined')
  76. begin
  77.     rOpenTest("{CDEVName} CDEV window location/Close tests");
  78.     
  79.     prep := true;
  80.     reset();
  81.     
  82.     if not open_control_panel(CDEVName)
  83.         prep := false;
  84.     else
  85.     begin
  86.         try 
  87.             match [window t:CDEVName r:?originalLocation]!;
  88.         catch theError
  89.             ExceptionDispatcher(theError,,{"Match 1 in CheckWindowLoc", {testType, testList, CDEVname}});
  90.     end;
  91.     
  92.     if not originalLocation
  93.         prep := false;
  94.     else
  95.     begin
  96.         try 
  97.             match [screen m:true r:?screenRect]!;
  98.         catch theError
  99.             ExceptionDispatcher(theError,,{"Match 2 in CheckWindowLoc", {testType, testList, CDEVname}});
  100.  
  101.         if not screenRect
  102.             prep := false;
  103.     end;
  104.     
  105.  
  106.     if prep
  107.     begin
  108.         for each test in testList                     #Loop through all tests
  109.         begin
  110.             if test[1] <= testType                     #Is the test in QL,Func or Comp?
  111.             begin
  112.                 TCSID := test[2];                    #Extract test parameters
  113.                 testName := test[3];                #Extract test parameters
  114.                 testLoc := test[4];
  115.                 testMethod := test[5];
  116.                 tResult := {};                        #initialize test result
  117.  
  118.                 ## SBR Comment:    this is the same description for all test cases
  119.                 TCSResultCode := 0; TCSErrStr := ''; TCSValue := ''; TCSString := '';
  120.                 TCSStart(TCSID, "save window location for a control panel");
  121.                 
  122.                                                     #Make sure we can see the whole title Bar
  123.                 _Drag([window o:1], 'a', {32, 64});
  124.                 _Drag([window o:1], 'a', testLoc);    #Begin test - position window
  125.                                                     #& verify!
  126.                 
  127.                 wRect := {};
  128.                 try 
  129.                     match [window t:CDEVName o:1 r:?wRect]!;
  130.                 catch theError
  131.                     ExceptionDispatcher(theError,,{"Match 3 in CheckWindowLoc", {[screen m:true], testList, CDEVname}});
  132.                 
  133.                 if (not wRect) or (wRect[1] <> testLoc[1]) or (wRect[2] <> testLoc[2])
  134.                 begin        ####    begin second attempt to move window
  135.                     wait(2);
  136.                     _Drag([window o:1], 'a', testLoc);    #try again; if fail, return with error
  137.                     
  138.                     wRect := {};
  139.                     try 
  140.                         match [window t:CDEVName o:1 r:?wRect]!;
  141.                     catch theError
  142.                         ExceptionDispatcher(theError,,{"Match 4 in CheckWindowLoc", {testType, testList, CDEVname}});
  143.                             
  144.                     if  (not wRect) or (wRect[1] <> testLoc[1]) or (wRect[2] <> testLoc[2])
  145.                     begin
  146.                         TCSResultCode := -1;
  147.                         TCSErrStr := "Unable to locate or drag window";
  148.                         tResult := {"incomplete",TCSErrStr};
  149.                     end;
  150.                 end;
  151.             
  152.                 if testMethod = "box"                 #How do we close?
  153.                 begin
  154.                     if not close_window()
  155.                     begin
  156.                         TCSResultCode := -1;
  157.                         TCSErrStr := "Unable to close window by close box";
  158.                         tResult := {"incomplete",TCSErrStr};
  159.                     end;
  160.                 end;
  161.                 else if testMethod = "menu"
  162.                 begin
  163.                     if not select_menuItem('Close Window','File')
  164.                     begin
  165.                         TCSResultCode := -1;
  166.                         TCSErrStr := "Unable to select Close Window menuItem";
  167.                         tResult := {"incomplete",TCSErrStr};
  168.                     end;
  169.                 end;
  170.                 else 
  171.                     key_eq('w');
  172.                                                     #    & verify!
  173.                 if not await_absence([window t:CDEVName])
  174.                 begin
  175.                     TCSResultCode := -1;
  176.                     TCSErrStr := "{CDEVName} CDEV didn't close properly using close {testMethod}";
  177.                     tResult := {"incomplete",TCSErrStr};
  178.                 end;
  179.  
  180.                 open_control_panel(CDEVName);        #Reopen & verify!
  181.                 
  182.                 newLocation := {};
  183.                 try 
  184.                     match [window t:CDEVName o:1 r:?newLocation]!;
  185.                 catch theError
  186.                     ExceptionDispatcher(theError,,{"Match 5 in CheckWindowLoc", {testType, testList, CDEVname}});
  187.  
  188.                 if tResult = {}                     #if no incompletes, do the main check
  189.                 begin
  190.                     if newLocation <> wRect
  191.                     begin
  192.                         TCSResultCode := 0;
  193.                         TCSErrStr := "{CDEVName} CDEV opened in wrong location when {testName}";
  194.                         tResult := {false, TCSErrStr};
  195.                         RAddResult("",    NumToStr(wRect[0]) + "," + NumToStr(wRect[1]),
  196.                                 NumToStr(newLocation[0]) + "," + NumToStr(newLocation[1]));
  197.                     end;
  198.                     else 
  199.                     begin
  200.                         TCSResultCode := 1;
  201.                         TCSErrStr := '';
  202.                         TCSString := "{testLoc}";
  203.                         tResult := {true, "{CDEVName} CDEV opened in correct location when {testName}"};
  204.                     end;
  205.                 end;
  206.                 
  207.                 ###    Report to Phoenix
  208.                 #println "TCSEnd(    {TCSID}, {TCSResultCode}, {TCSErrStr}, {TCSValue} )";
  209.                 TCSEnd(    TCSID, TCSResultCode, TCSErrStr, (*TCSValue*), TCSString );
  210. #                TCSEnd(        pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := 0, 
  211. #                            pTCSStr := '', pCommentStr := '', pExceptionFlag := '');
  212. #                
  213.                 rResult(tResult[1], tResult[2]);    #report the findings
  214.             end;
  215.         end;
  216.         
  217.         #Restore initial conditions
  218.         _Drag([window o:1], 'a', {originalLocation[1], originalLocation[2]});
  219.     end;
  220.     else                                            # Error from the get-go
  221.         rResult("incomplete", "{CDEVName} CDEV window not found");
  222.     
  223.     rCloseTest();
  224. end;
  225.  
  226. #########################################################################
  227. #    task            CheckHelpBalloons(testType, testList, fullPathName)
  228. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  229. #    Description:    Turns Help Balloons on, moves around enabling and checking
  230. #                    them, then turns them off again.
  231. #    Parameters:        testType:= 1,2,3 for QuickLook, Functional, InDepth
  232. #                    testList:=    {test1, test2, ... testN}
  233. #                        testN: { testType, TCSID, nameOfTest, mouseLoc, expectedChecksum }
  234. #                            testType:    1 = QuickLook, 2 = Functional, 3 = Comprehensive
  235. #                            TCSID:        { Number (int), Set (str), Type (str), Owner (str) }
  236. #                            nameOfTest:    short test description (TCSDescription)
  237. #                            mouseLoc:    where to point to make the balloon appear
  238. #                            expectedChecksum:     string to compare against VUAid('balloon')
  239. #                    fullPathName (optional): if included, will open the pathName
  240. #                        given.  Default is to operate on current status of windows.
  241. #    Returns:        Nothing
  242. #    Examples:        sampletest:= {
  243. #                        { 1, {1,'SampleCP','BalloonHelp','HLQ'}, "close box", {15, 10}, '11305'}
  244. #                        { 1, {2,'SampleCP','BalloonHelp','HLQ'}, "title bar", {60, 10},    '34759'}
  245. #                    };
  246. #                    CheckHelpBalloons(1, sampletest);
  247. #    Assumptions:    None
  248. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  249. #    History:
  250. #    3/19/92        Jon Marsh        Created
  251. #    2/24/94        Gary Kratzer    If help ballon checksum test fails, move the mouse to another
  252. #                                location, move it back to the test location, wait a few seconds,
  253. #                                then test it again. If this test fails, then fail the test. We
  254. #                                do this because sometimes the wrong help balloon appears if the
  255. #                                cursor passes over another help region on the way to the test
  256. #                                location, and VUAid is called before the correct balloon gets
  257. #                                displayed.
  258. #    06/21/94    SBR            Mods for TCS.lib; added comments for TestN;
  259. #    09/27/96    BRL/MSO        Added SPEC exception handling
  260. #########################################################################
  261. task    CheckHelpBalloons(testType:= 1, testList:= {}, fullPathName := "", NameOpenTest:= "")
  262. begin
  263.     if NameOpenTest <> "" 
  264.         NameOpenTest := " for " + NameOpenTest;
  265.     rOpenTest("Help Balloon verification tests {NameOpenTest}");
  266.     
  267.     if fullPathName <> ""
  268.     begin
  269.         reset();
  270.         open_by_path(fullpathName);
  271.     end;
  272.     
  273.     try 
  274.         match [menuItem t:?balloonsOn:/≈Balloons≈/];
  275.     catch theError
  276.         ExceptionDispatcher(theError,,{"CheckHelpBalloons", 
  277.             {testType, testList, fullPathName, NameOpenTest}});
  278.  
  279.     if balloonsOn = 'Hide Balloons'
  280.         success := true;
  281.     else
  282.         success := select_descriptor([menuItem t:'Show Balloons']!);
  283.  
  284.     if success 
  285.     begin
  286.         for each test in testList
  287.         begin
  288.             if test[1] <= testType
  289.             begin
  290.                 TCSID := test[2];
  291.                 testName := test[3];
  292.                 testLoc := test[4];
  293.                 expected := test[5];
  294.  
  295.                 TCSResultCode := 0; TCSErrStr := ''; TCSValue := ''; TCSString := '';
  296.                 TCSStart(TCSID, "help balloon ckecksum for {testName}");
  297.                 
  298.                 if TypeOf(testLoc[1]) = "list" or TypeOf(testLoc[1]) = "string"
  299.                     move_mouse(testLoc);
  300.                 else
  301.                     move_mouse({testLoc});
  302.  
  303.                 actual := VUAid("Balloon");
  304.  
  305.                 ### If test fails, move the mouse and try again
  306.                 ### Changed from (actual <> expected) for Radar 1276224
  307.                 if not (actual = expected)
  308.                 begin
  309.                     move_mouse({'absolute',{0,0}}, 2);        
  310.                     if TypeOf(testLoc[1]) = "list" or TypeOf(testLoc[1]) = "string"
  311.                         move_mouse(testLoc);
  312.                     else
  313.                         move_mouse({testLoc});
  314.                     wait(2);
  315.                     actual := VUAid("Balloon");
  316.                 end;
  317.  
  318.                 if typeOf(actual) = 'string'
  319.                     TCSValue := strToNum(actual);        #current type for VU 2.0.1
  320.                 else 
  321.                     TCSValue := actual;                #future type for VU 2.1
  322.  
  323.                 if actual = expected
  324.                 begin
  325.                     TCSResultCode := 1;
  326.                     TCSErrStr := '';
  327.                     tResult := {true,"balloon for {testName}"};
  328.                 end;
  329.                 else 
  330.                 begin
  331.                     TCSResultCode := 0;
  332.                     TCSErrStr := "expected checksum was {expected}";
  333.                     tResult := {false,"balloon for {testName}"};
  334.                 end;
  335.                 
  336.                 ###    Report to Phoenix
  337.                 #println "TCSEnd(    {TCSID}, {TCSResultCode}, {TCSErrStr}, {TCSValue} )";
  338.                 TCSEnd(    TCSID, TCSResultCode, TCSErrStr, TCSValue );
  339. #                TCSEnd(        pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := 0, 
  340. #                            pTCSStr := '', pCommentStr := '', pExceptionFlag := '');
  341. #                
  342.                 CAidedSE := {test, {-4, "Balloon"}};
  343.                 rResult (tResult[1],tResult[2], expected, actual,,CAidedSE);    #log results of the test
  344.             end;
  345.         end;
  346.     end;
  347.     
  348.     ## SBR Comment: how do we report this or the next 'if' to TCS?
  349.     else                                        # Error from the get-go
  350.         rResult("incomplete", "Unable to enable help balloons");
  351.         
  352.     if not select_descriptor([menuItem t:'Hide Balloons']!)
  353.         rIncomplete("Incomplete: Unable to disable help balloons");
  354.  
  355.     rCloseTest();
  356. end;
  357.  
  358. #########################################################################
  359. #    task            _IconsSetup(ItemName, kTempFolderName, ThisDir)
  360. #    Description:    Sets up environment for CheckIcons.
  361. #    Parameters:        itemName:            Name of item to test
  362. #                    kTempFolderName:    Name of new temporary folder
  363. #                    ThisDir:            Pathname to Control Panels folder
  364. #    Returns:        error string - "none" indicates successful completion
  365. #    History:
  366. #    4/6/92        Jon Marsh    Created
  367. #    10/04/93    Jay Loucks    Turn off 'show disk info in header' to
  368. #                            ensure that title bar is expected height
  369. #    11/9/93        Jay Loucks    Change open_control_panel() call to use
  370. #                            new parameter to not close Control Panels window
  371. #    09/27/96    BRL/MSO        Added SPEC exception handling
  372. #########################################################################
  373. task    _IconsSetup(ItemName, kTempFolderName, ThisDir)
  374. begin
  375.                                                 # Open and locate Views CDEV
  376.     rStatus("_IconsSetup: Configuring windows for {ItemName} icon verification tests", 4);
  377.     try 
  378.         match [window t:?ourWindow o:1];
  379.     catch theError
  380.         ExceptionDispatcher(theError,,{"match 1 in _IconsSetup", {ItemName, kTempFolderName, ThisDir}});
  381.     
  382.     ###    JDL    Open Views, but do not close Control Panels window    
  383.     if not open_control_panel("Views",false)
  384.         return("Couldn∂'t open Views CDEV");
  385.     
  386.     if ourWindow <> "Control Panels"
  387.     begin
  388.         _Select([window t:"Control Panels"]);
  389.         if not select_menuItem("Close Window","File") 
  390.             return ("Unable to close Control Panels window");
  391.     end;
  392.     
  393.     _Drag([window o:1 t:"Views"], 'a', {110, 25});
  394.     try 
  395.         match [window o:1 t:"Views" r:?wRect]!;
  396.     catch theError
  397.         ExceptionDispatcher(theError,,{"match 2 in _IconsSetup", {ItemName, kTempFolderName, ThisDir}});
  398.     
  399.     ###    JDL if show disk info in header is on, turn it off
  400.     if _MatchBoolean([checkbox t:'Show disk info in header' s:{1,1}])
  401.         if not select_descriptor([checkbox t:'Show disk info in header']) 
  402.             return ("Unable to turn off disk info in header");
  403.  
  404.     if (wRect[1] <> 110) or (wRect[2] <> 25)
  405.         return ("Unable to move Views window");
  406.  
  407.     # Return to window, make an alias
  408.     #    of desired item
  409.     _Select([window t:ourWindow]);
  410.     type_keys({tabKey});
  411.  
  412.     if not type_keys({ItemName, 'latch', commandKey, 'i'})
  413.         return("type_keys error (1)");
  414.  
  415.     if not await_presence([window o:1 t:(ItemName + " Info")])
  416.         return("Wrong Item selected?");
  417.  
  418.     if not select_MenuItem("Close Window","File")
  419.         return("Unable to select Close menuItem for info window");
  420.  
  421.     if not await_presence([window t:ourWindow]) 
  422.         return("original window is not foremost");
  423.  
  424.     if not select_MenuItem("Make Alias","File")
  425.         return("Unable to make Alias");
  426.  
  427.     if not select_MenuItem("None","Label")
  428.         return("Unable to select Label:none");
  429.     
  430.     # Make a temporary folder to put it in
  431.     if not select_MenuItem("New Folder","File")
  432.         return("Unable to make new folder");
  433.  
  434.     if not type_keys({kTempFolderName, returnKey})
  435.         return("type_keys error (2)");
  436.  
  437.     if await_presence([staticText t:/≈Please use a different name≈/],2,,,6)
  438.     begin
  439.         type_keys({returnKey});
  440.         VUAid("Delete", {ThisDir + kTempFolderName});
  441.         type_keys({kTempFolderName});
  442.     end;
  443.  
  444.     if not type_keys({'latch', commandKey, 'latch', optionKey, downarrowKey})
  445.         return("type_keys error (3)");
  446.  
  447.     if not await_presence([window o:1 t:kTempFolderName])
  448.         return("Unable to open temp folder");
  449.  
  450.     if not select_MenuItem("by Name","View")
  451.         return("Unable to view by name");
  452.  
  453.     if not relocate_window( {5,25,105,145})
  454.         return("Relocating temp folder failed");
  455.     
  456.     # Move our alias to the folder
  457.     if not VUAid("Move", {ThisDir + ItemName + " alias", ThisDir + kTempFolderName})
  458.         return ("Unable to move alias into temp folder");
  459.     return("none");
  460. end;
  461.  
  462. #########################################################################
  463. #    task            CheckIcons(testType, testList, ItemName, ThisDir)
  464. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  465. #    Description:    Checks that an icon is displayed properly, with variable
  466. #                    sizes and bit-depths.
  467. #    Parameters:        testType:= 1,2,3 for QuickLook, Functional, Comprehensive
  468. #                    testList:=    {test1, test2, ... testN}
  469. #                        testN: { testType, TCSID, bitDepth, iconSize, selected, expectedChecksum, gray}
  470. #                            testType:    1 = QuickLook, 2 = Functional, 3 = Comprehensive
  471. #                            TCSID:     { Number (int), Set (str), Type (str), Owner (str) }
  472. #                            bitDepth:     depth at which to measure the checksum
  473. #                            iconSize:     'small', 'normal', or 'large' icon as set in Views CP
  474. #                            selected:     measure with icon highlighted (true) or not (false)
  475. #                            expectedChecksum:     string to compare against VUAid('CompareWindowRect')
  476. #                            gray:     Monitors CP set to Grays 'grays' or Colors (nothing)
  477. #                    ItemName:    Name of Item to test
  478. #                    ThisDir:    window which contains the icon to be checked
  479. #                                defaults to Control Panels folder
  480. #    Returns:        None
  481. #    Examples:        testList:= {
  482. #                        {1, {1,'SampleCP','Icon','HLQ'}, 8, "large", false,    457},
  483. #                        {1, {2,'SampleCP','Icon','HLQ'}, 8, "normal", true, 23749, 'grays'}
  484. #                    };
  485. #                    CheckIcons(1, testList, "Monitors");
  486. #    Assumptions:    Calls _IconsSetup
  487. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  488. #    History:
  489. #    4/6/92        Jon Marsh        Created
  490. #    10/04/93    Jay Loucks        Changed to CompareWindowRect from 
  491. #                                Compare32WindowRect to remove variation 
  492. #                                in results.
  493. #    2/9/94        Donal O'Hare     Grays Setting in Monitors CP will now default to
  494. #                                Colors unless otherwise specified. 
  495. #    06/21/94    SBR    Mods for TCS.lib; added comments for TestN;
  496. #########################################################################
  497. task    CheckIcons(testType:= 1, testList:= {}, ItemName := "", ThisDir := "")
  498. begin
  499.     rOpenTest("Icon display verification tests for {ItemName}");
  500.     kTempFolderName := "@!@ DeleteMe";
  501.     if ThisDir = ""
  502.         ThisDir := VUAid("Findfolder", {"ctrl"}) + ":";
  503.     if ThisDir[card ThisDir] <> ":" ThisDir := ThisDir + ":";
  504.     
  505.     reset();    
  506.     open_by_path(ThisDir);
  507.     
  508.     error := _IconsSetup(ItemName, kTempFolderName, ThisDir);
  509.     if error = "none"
  510.     begin
  511.         oldBitDepth := VUAid("GetDepth");        # Remember for resoration
  512.         oldGray := VUAid("GetGray");
  513.         
  514.         currentBitDepth := oldBitDepth;            # Optimize repetitive setups
  515.         currentGray := oldGray;
  516.         currentView := "who knows?";
  517.         bitDepthNA := 0;                        # Last known bit-depth unavailable on this machine
  518.         grayNA := -1;                            # Last known gray setting unavailable on this machine
  519.         testGray := 0;                            # DOH: Default the Grays Setting in Monitors CP to Colors
  520.         testGrayText := 'colors';                # SBR: Default to colors for the text, also.
  521.         
  522.         for each test in testList
  523.         begin
  524.             if test[1] <= testType
  525.             begin
  526.                 TCSID := test[2];
  527.                 testBitDepth := test[3];
  528.                 testView := test[4];
  529.                 testSelected := test[5];
  530.                 if testSelected
  531.                     testSelectedText := "selected";
  532.                 else testSelectedText := "unselected";
  533.                 expected := test[6];
  534.                 if card test > 6         # DOH: Check to see if the Grays Setting in Monitors CP
  535.                 begin                      #        is given and set it appropriately.
  536.                     testGrayText := test[7];
  537.                     if testGrayText = 'grays'
  538.                         testGray := 1;
  539.                     else begin
  540.                         testGrayText := 'colors';
  541.                         testGray := 0;
  542.                     end;
  543.                 end;
  544.  
  545.                 TCSResultCode := 0; TCSErrStr := ''; TCSValue := ''; TCSString := '';
  546.                 TCSDescription := "Color CP icon checksum, {testView}, {testSelectedText}";
  547.                 TCSDescription := "{TCSDescription}, in {testBitDepth}-bit {testGrayText}";
  548.                 TCSStart(TCSID, TCSDescription);
  549.                 
  550.                 actual := "";
  551.                 tResult := {};
  552.                                                 #Skip test if we know that the bit-depth or gray setting is not available
  553.                 if (testBitDepth <> bitDepthNA) and (testGray <> grayNA) 
  554.                 begin                            # Change our icon size
  555.                     if testView <> currentView
  556.                     begin
  557.                         select_window("Views");
  558.                         if testView = "large"
  559.                         begin
  560.                             move_mouse({{130,187}, 'click'});
  561.                             checkSumRect := {24, 22, 56, 54};    #32x32
  562.                         end;
  563.                         else if testView = "small"
  564.                         begin
  565.                             move_mouse({{94,187}, 'click'});
  566.                             checkSumRect := {22, 21, 38, 37};    #16x16
  567.                         end;
  568.                         else begin
  569.                             move_mouse({{58,187}, 'click'});
  570.                             checkSumRect := {20, 22, 32, 34};    #12x12
  571.                         end;
  572.                         select_window(kTempFolderName);
  573.                     end;
  574.                                                     # Select or de-select it
  575.                     if testSelected 
  576.                     begin
  577.                         key_eq("a");
  578.                         testSelected := "true";    # Redefine our boolean as a string for logging purposes
  579.                     end;
  580.                     else begin
  581.                         move_mouse({{5, 45}, 'click'});
  582.                         testSelected := "false";
  583.                     end;
  584.                                                 # Change our bit-depth
  585.                     if (testBitDepth <> currentBitDepth)
  586.                     begin
  587.                         VUAid("SetDepth", {testBitDepth});
  588.                         b := VUAid("GetDepth");
  589.                         if b <> testBitDepth
  590.                         begin
  591.                             bitDepthNA := testBitDepth;
  592.                             tResult := {"incomplete", "Unable to set bit depth to {testBitDepth} with gray:{testGray}"};
  593.                             TCSResultCode := -1;
  594.                             TCSErrStr := "Unable to set bit depth to {testBitDepth} with gray:{testGray}";
  595.                         end;
  596.                     end;
  597.                                                 # Change our grays
  598.                     if (testGray <> currentGray)
  599.                     begin
  600.                         VUAid("SetGray", {testGray});
  601.                         b := VUAid("GetGray");
  602.                         if b <> testGray
  603.                         begin
  604.                             grayNA := testGray;
  605.                             tResult := {"incomplete", "Unable to set grays to {testGray}"};
  606.                             TCSResultCode := -1;
  607.                             TCSErrStr := "Unable to set grays to {testGray}";
  608.                         end;
  609.                     end;
  610.                     
  611.                     if tResult = {}                 # Do our checksum over our region
  612.                     begin
  613.                         ####    JDL - changed VUAid call from 'CompareWindow32Rect'
  614.                         ####        to CompareWindowRect to remove variation in results
  615.                         actual := VUAid("CompareWindowRect", checkSumRect);
  616.                         
  617.                         if actual <> integer
  618.                             TCSValue := strToNum(actual);        #current type for VU 2.0.1
  619.                         else TCSValue := actual;                #future type for VU 2.1
  620.                         
  621.                         TCSResultCode := actual = expected;
  622.                         if TCSResultCode
  623.                             TCSResultCode := 1;
  624.                         else TCSResultCode := 0;
  625.                         tResult := { TCSResultCode, TCSDescription };
  626.  
  627.                         if TCSResultCode
  628.                         begin
  629.                             TCSErrStr := '';
  630.                         end;
  631.                         else begin
  632.                             TCSErrStr := "expected checksum was {expected}";
  633.                             ####    DOH -  If failing > Alert users to check that the testCases contain the correct CheckSum's. 
  634.                             RStatus("NB: Check that- gray -is included in the testCases if Gray Checksums are being used.");
  635.                         end;
  636.                     end;
  637.                     else actual := expected;
  638.                     
  639.                     currentView := testView;
  640.                     currentBitDepth := testBitDepth;
  641.                     currentGray := testGray;
  642.                 
  643.                     ###    Report to Phoenix
  644.                     #println "TCSEnd(    {TCSID}, {TCSResultCode}, {TCSErrStr}, {TCSValue} )";
  645.                     TCSEnd(    TCSID, TCSResultCode, TCSErrStr, TCSValue );
  646. #                    TCSEnd(        pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := 0, 
  647. #                                pTCSStr := '', pCommentStr := '', pExceptionFlag := '');
  648. #                
  649.                     CAidedSE := {test, { -5, "CompareWindowRect", checkSumRect}};
  650.                     rResult(tResult[1], tResult[2], expected, actual,,CAidedSE);
  651.                 end;
  652.             end;
  653.         end;
  654.                                                 # Restore original settings
  655.         if oldBitDepth <> currentBitDepth
  656.             VUAid("SetDepth", {oldBitDepth});
  657.         VUAid("SetGray", {oldGray});
  658.                                                 # Delete temporary stuff    
  659.         if not VUAid("Delete", {ThisDir + kTempFolderName + ":" + ItemName + " Alias"})
  660.             rIncomplete("Incomplete: Unable to delete alias to CDEV ∂'{ItemName}∂'");
  661.         else if not VUAid("Delete", {ThisDir + kTempFolderName})
  662.             rIncomplete("Incomplete: Unable to delete temporary folder ∂'{kTempFolderName}∂'");
  663.         close_window("Views");
  664.  
  665.     end;
  666.     else                                            # Error from the get-go
  667.         rResult("incomplete","{error}");
  668.  
  669.     rCloseTest();
  670. end;
  671.  
  672.  
  673. #########################################################################
  674. #    task            CheckActions(testType, testList)
  675. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  676. #    Description:    combines several diverse handlers and verification
  677. #                    methods into one handler
  678. #    Parameters:        testList:=    {test1, test2, ... testN}
  679. #                        testN: { testType, testName, genericActionLists, expectedDesc}
  680. #                            testType:    1,2,3 for QuickLook, Functional, Comprehensive
  681. #                            testName:    name of this testcase
  682. #                            genericActionLists: { actionList1Type, actionList1,..., actionListNType, actionListN}
  683. #                                actionListNType: "move_mouse", "type_keys",
  684. #                                    "scrapbook", "menus", "pushCheckSum", "verifyCheckSum"
  685. #                                actionListN: Depends on actionListNType:
  686. #                                    "move_mouse":    parameters to pass to move_mouse
  687. #                                    "type_keys":    parameters to pass to type_keys
  688. #                                    "scrapbook":    parameters to pass to scrapbook
  689. #                                    "menus":        list of menu names to select.
  690. #                                                    If only 1 char long use key_eq.
  691. #                                    "pushCheckSum":
  692. #                                        { VUAidCommandString, parameterList}
  693. #                                            VUAidCommandString: VUAid command string to execute.
  694. #                                                Push result onto stack. Can be used (popped off
  695. #                                                stack) later by verifyCheckSum
  696. #                                            parameterList:    parameters to send to VUAid.
  697. #                                    "verifyCheckSum":
  698. #                                        { VUAidCommandString, parameterList, change, checkSum}
  699. #                                            VUAidCommandString: VUAid command string to execute.
  700. #                                            parameterList:    parameters to send to VUAid.
  701. #                                            change:        true/false - was change expected?
  702. #                                            checkSum:    resulting checkSum or checkSumList to verify. If
  703. #                                                        empty pop checkSum off getCheckSumStack.
  704. #                    testType:= 1,2,3 for QuickLook, Functional, Comprehensive
  705. #    Returns:        Nothing
  706. #    Examples:        testList:= {
  707. #                        { 1, "cut of 1st sound", {
  708. #                            "pushCheckSum", {"CompareWindowRect", {158, 22, 297, 35}},
  709. #                            "move_mouse", {gScrollUpArrowLoc, 'down', 'wait3', 'up', gSound1Loc, 'click'},
  710. #                            "menus", {"Cut"},
  711. #                            "verifyCheckSum", {"CompareWindowRect", {158, 22, 297, 35}, true}
  712. #                        },    [window o:1 t:"Sound"]}
  713. #                    };
  714. #                    CheckActions(1, testList);
  715. #    Assumptions:    None
  716. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  717. #    History:
  718. #    4/9/92        Jon Marsh    Created
  719. #    6/9/92        Jon Marsh    Added stack for checksum verification
  720. #                            Updated for rResult logging.
  721. #    09/27/96    BRL/MSO        Added SPEC exception handling
  722. #########################################################################
  723. task    CheckActions( testType:= 1, testList:= {})
  724. begin
  725.     rOpenTest("generic action verification tests");
  726.  
  727.     noErr:= true;
  728.     inc := false;
  729.     originalCheckSum:= {};
  730.     for each test in testList
  731.     begin
  732.         if test[1] <= testType
  733.         begin
  734.             testName := test[2];
  735.             genericActionLists := test[3];
  736.             expectedDesc := test[4];
  737.             
  738.             if rXStatus(5)
  739.                 println "Processing generic actionList: ", test;
  740.             while card genericActionLists > 0
  741.             begin
  742.                 actionType:= genericActionLists[1];
  743.                 actionList:= genericActionLists[2];
  744.                 genericActionLists:= remove(1, genericActionLists);
  745.                 genericActionLists:= remove(1, genericActionLists);
  746.                 
  747.                 CAidedSE:= {};
  748.                 if actionType = "move_mouse"
  749.                     noErr:= move_mouse(actionList);
  750.                 else if actionType = "type_keys"
  751.                     noErr:= type_keys(actionList);
  752.                 else if actionType = "scrapbook"
  753.                     noErr:= scrapbook(actionList);
  754.                 else if actionType = "menus" 
  755.                 begin
  756.                     for each m in actionList 
  757.                     begin
  758.                         if card m = 1
  759.                             noErr:= key_eq(m);
  760.                         else
  761.                             noErr := select_descriptor([menuItem t:m]);
  762.                         if not noErr
  763.                             actionList := {};
  764.                     end;
  765.                 end;
  766.                 else if actionType = "pushCheckSum" 
  767.                 begin
  768.                     if typeOf(actionList[1]) = 'string'
  769.                         originalCheckSum := originalCheckSum + { VUAid(actionlist[1], actionList[2]) };
  770.                     else
  771.                         inc := rAddResult("pushCheckSum needs a VUAid command and parameter list");
  772.                 end;
  773.                 else if actionType = "verifyCheckSum" 
  774.                 begin
  775.                     if card actionList < 4 
  776.                     begin
  777.                         checkSum := originalCheckSum[1];
  778.                         originalCheckSum := remove(1, originalCheckSum);
  779.                     end;
  780.                     else 
  781.                     begin
  782.                         checkSum := actionList[4];
  783.                         CAidedSE := { {checkSum}, {-1, actionList[1]} };
  784.                         if typeOf(checkSum) = 'list' 
  785.                         begin
  786.                             checkSum := whichCheckSum(checkSum);
  787.                             CAidedSE := { {checkSum}, {1, actionList[1]} };
  788.                         end;
  789.                     end;
  790.                     if typeOf(actionList[1]) = 'string' 
  791.                     begin
  792.                         newCheckSum := VUAid(actionList[1], actionList[2]);
  793.                         if actionList[3] = (newCheckSum <> checkSum) 
  794.                         begin
  795.                             if actionList[3]
  796.                                 rAddResult("Verified change in display for {testName}");
  797.                             else
  798.                                 rAddResult("Verified no change in display for {testName}");
  799.                         end;
  800.                         else 
  801.                         begin
  802.                             noErr:= false;
  803.                             if actionList[3]
  804.                                 rAddResult("Unable to verify changed display for {testName}",checkSum,newCheckSum);
  805.                             else
  806.                                 rAddResult("Unable to verify unchanged display for {testName}",checkSum,newCheckSum);
  807.                         end;
  808.                     end;
  809.                     else
  810.                         inc := rAddResult("verifyCheckSum needs a VUAid command string");
  811.                 end;
  812.                 else
  813.                     inc := rAddResult("checkActions recieved bad actionType: {actionType}");
  814.  
  815.                 if (not noErr) or inc 
  816.                 begin
  817.                     rAddResult("Aborting generic action handler");
  818.                     genericActionLists:= {};
  819.                 end;
  820.                 
  821.             end; # while card genericActionLists > 0
  822.                 
  823.             if noErr and (not inc)
  824.                 if not await_presence(expectedDesc,,,,6)           #v_level 6 to suppress errors
  825.                     noErr := not rAddResult("Expected descriptor not found for {testName}");
  826.             if inc 
  827.                 noErr := "incomplete";
  828.             rResult(noErr, "{testName}",,,, CAidedSE);
  829.             
  830.             while _MatchBoolean([button t:"Cancel"]) or _MatchBoolean([button t:"OK"])
  831.             begin
  832.                 if _MatchBoolean([button t:"Cancel"])
  833.                     select_descriptor([button t:"Cancel"]);
  834.                 else
  835.                     select_descriptor([button t:"OK"]);
  836.             end;
  837.         end;        #if test[1] <= testType
  838.     end;            #for each test in testList
  839.  
  840.     rCloseTest();
  841. end;
  842.  
  843.  
  844. ##########################################################################################
  845. #    task            CheckRadioButton(testType, testList, cdev)
  846. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  847. #    Description:    Checks that a RadioButton(radiobutton) is selected properly.
  848. #    Parameters:        
  849. #                    testList:    {testType, testName, buttonLocation, buttonList,
  850. #                                    MemSize, MemLocation, expected}
  851. #
  852. #                        testType:    1 = QL, 2 = Func, 3 = Comp
  853. #                        testName:    string identifying this particular test
  854. #                        buttonLocation:    location of the button being clicked
  855. #                        buttonList:    List of all buttons in the radio group where 
  856. #                                    each element is a location (see Note 2 below)
  857. #                                    and a highlight state ie., true or false.
  858. #                        MemSize:    Size of memory element to check 
  859. #                                        (see VUAid 2.0 documentation).
  860. #                        MemLocation: Address of memory element to check
  861. #                                        (see VUAid 2.0 documentation).
  862. #                        expected:    expected value of memory location
  863. #
  864. #                        NOTE: 1)if no memory Location test needed, 
  865. #                                pass no variables forMemSize, MemLocation, 
  866. #                                and expected using commas{…,,,}, 
  867. #                                and this area will be ignored.
  868. #                              2)The radio button location is given by 
  869. #                                it's central x,y coordinates.
  870. #
  871. #                    cdev:      { Control Panel Name , {x,y offset}}
  872. #                        Cdev Name:  Control Panel Name whose RadioButtons 
  873. #                                    are to be tested.
  874. #                        x,y offset: Because CompareWindowRect uses a different
  875. #                                    reference point to move_mouse,this  offset must
  876. #                                    be given. eg. For most Control Panels the offset
  877. #                                    is { 0, -20},for Date & Time it is { -8, -10}, etc.
  878. #                                    
  879. #    Returns:        Nothing
  880. #    Example:        
  881. #            cdev := { "Memory", { 0, -20}};
  882. #            testCases := {
  883. #                          {1, 'Symbol : Virtual Memory', {72, 125}, {{{72, 125}, 'true'},
  884. #                          {{72, 139}, 'false'} } }
  885. #                         };
  886. #            CheckRadioButton(3, testCases, cdev);        
  887. #    NB:
  888. #        1)  Using "InvertWindowRect" the offset can be found by calculating the difference between 
  889. #            the actual inverted area and the expected area.
  890. #        2)    The coordinates for each buttonLocation must be the central x,y coordinates  
  891. #            relative to the window.
  892. #        3)  To ensure that the correct buttonLocation coordinates are given it may be necessary to
  893. #            calculate an area of 12*12 pixels(see CheckRadioButton task)  and invert this area 
  894. #            using InvertWindowRect. Note: The inverted area must be directly on the appropriate
  895. #            RadioButton,if not,change the buttonLocation coordinates.
  896. #
  897. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  898. #    History:
  899. #        4/14/92        Al Allamsetty    Created
  900. #        10/04/93    Jay Loucks        Changed call to GetMemory to
  901. #                                    work with VUAid 2.0 which requires a
  902. #                                    memory size and location. Updated header.
  903. #       1/13/94     Donal 0'Hare    Modified to fix Radar bug  No. 1131363 & Updated header
  904. #       3/15/94     DOH                Changed "rCloseTest(,true)" to "rCloseTest()"
  905. ##########################################################################################
  906. task    CheckRadioButton(testType, testList:= {}, cdev:= {}) 
  907. begin
  908.  
  909.     CurBitDepth := VUAid("GetDepth");
  910.     CurGrays := VUAid("GetGray");
  911.     cdevName :=    cdev[1];
  912.     offset      := cdev[2];
  913.     rOpentest("RadioButton tests for {cdevName}");
  914.     prep := true;
  915.     
  916.     if not open_control_panel(cdevName) prep := false;
  917.         
  918.     if prep begin
  919.         for each test in testList begin
  920.             if test[1] <= testType begin
  921.                 testName         :=    test[2];
  922.                 buttonLocation     :=     test[3];
  923.                 buttonList        :=     test[4];
  924.                 tResult := {};
  925.                 
  926.                 move_mouse({buttonLocation, 'click'});
  927.             
  928.                 if card test > 4 begin                    #Only perform memLocation test if defined
  929.                     ####    JDL - change call to work with VUAid 2.0 wich requires 
  930.                     ####        a size parameter
  931.                     MemSize        :=     test[5];
  932.                     MemLocation :=     test[6];
  933.                     expected     :=     test[7];
  934.                     actual     :=  VUAid("GetMemory",{ MemSize, MemLocation });
  935.                     if actual = expected 
  936.                         rAddResult("Verified: memory verification of radioButton {testName}");
  937.                     else begin
  938.                         tResult:= {false, "{testName} memory verification"};
  939.                         RAddResult("VUAid command GetMemory:",expected, actual);
  940.                     end;
  941.                 end;
  942.                 
  943.                 visualPassed := true;
  944.                 move_mouse( {{0,0}, 'relToWindow'} );   #Remove Mouse from radio button area.
  945.                 
  946.                 for each list in buttonList begin
  947.                     if tResult = {} begin
  948.                         buttonCoor     :=    list[1];
  949.                         enabled        :=    list[2];                    
  950.                         coorx    :=    buttonCoor[1];
  951.                         coory    :=    buttonCoor[2];
  952.                         ###Calculate the coordinates of an area 12*12pixel's on the RadioButton.
  953.                         windc1 :=   buttonCoor[1] - 6 + offset[1];
  954.                         windc2 :=    buttonCoor[2] - 6 + offset[2];
  955.                         windc3 :=    buttonCoor[1] + 6 + offset[1];
  956.                         windc4 :=    buttonCoor[2] + 6 + offset[2];
  957.  
  958.                         state    :=    VUAid("CompareWindowRect", {windc1, windc2, windc3, windc4}, 4);
  959.                                                 # Checksumlist for unselected radiobutton
  960.                         if state = whichCheckSum({ -13602,-14022,-13316,-26632,-20416,28768},CurBitDepth, CurGrays) 
  961.                              act := 'false';
  962.                                                  # Checksumlist for selected radiobutton
  963.                         else if state = whichCheckSum({ 5102,8938,-32196,1144,-26816,10976 },CurBitDepth, CurGrays) 
  964.                                    act := 'true';
  965.                              else  act := 'Unknown';
  966.                         if (act <> enabled or act = 'Unknown') visualPassed := false ;
  967.                         if not visualPassed 
  968.                         tResult := {false,  "CompareWindow verification of RadioButton {testName}"};
  969.                     end; #if tResult
  970.                     
  971.                 end;    #for each list
  972.                                                 
  973.                 if tResult = {} 
  974.                     tResult := {true, "RadioButton {testName}"};
  975.                 rResult(tResult[1], tResult[2]);
  976.             
  977.             end;     #if testType
  978.         end; #for each test
  979.         if card buttonList > 1 and visualPassed
  980.             RAddResult("Verified: all RadioButtons in correct state.");
  981.      end;    #if match
  982.      else rResult("incomplete","Could not find an open {cdevName} window");
  983.      rCloseTest();
  984. end;
  985.  
  986.  
  987.     
  988. #########################################################################
  989. #    task            _OpenBy(method, itemName, aliasIt)
  990. #    Description:    Opens a CDEV by specified method.  This is a support
  991. #                    task to CheckOpenCloseCDEV.
  992. #    Parameters:        Discussed in CheckOpenCloseCDEV header
  993. #    Returns:        true:    successful completion
  994. #                    false:    if any test was incomplete or if given an
  995. #                            invalid test case
  996. #    History:
  997. #    04/02/92    SBR            Created
  998. #    09/27/96    BRL/MSO        Added SPEC exception handling
  999. #########################################################################
  1000. task    _OpenBy(method, itemDescriptor, itemWindow, itemName, targetFile, aliasIt)
  1001. begin
  1002.     global gAliasMade;
  1003.     
  1004.     rStatus("Preparing item {itemName}.", 4);
  1005.     
  1006.     if isUndefined(global ctrlPath)
  1007.         ctrlPath := VUAid ("FindFolder", {"ctrl"});
  1008.  
  1009.     if not _MatchBoolean([window t:"Control Panels" o:1])
  1010.     begin
  1011.         reset();                    #close all windows
  1012.         if not open_control_panel()
  1013.             return {"incomplete","Unable to open Control Panels"};
  1014.     end;
  1015.         
  1016.     if aliasIt 
  1017.     begin
  1018.         if not gAliasMade
  1019.         begin
  1020.             if not select_named_item(itemName)
  1021.                 return  {"incomplete","Unable to select_named_item"};
  1022.             if not select_menuItem('Make Alias', 'File')
  1023.                 return {"incomplete","Unable to select_menuItem"};
  1024.             
  1025.             #must clean up again or the alias may be behind another icon
  1026.             if not CleanUpByName()
  1027.                 return {"incomplete","Unable to select_named_item"};    
  1028.             global gAliasMade := true;
  1029.         end;
  1030.         targetItem := itemName + " alias";
  1031.     end;
  1032.     else targetItem := itemName;
  1033.     
  1034.     if method <> "appleMenu"                #appleMenu doesn't use a point to icon routine
  1035.         if not point_to_sys_icon(ctrlPath, targetItem, "Control Panels") 
  1036.             return {"incomplete","Unable to point_to_sys_icon for {method}"};
  1037.     
  1038.     rStatus("Finished preparing {targetItem}.", 4);
  1039.  
  1040. ###    At this point the item is selected and ready to open. If we are about to doubleClick 
  1041. ### the pointer is over the icon and ready for clicking.
  1042.  
  1043.     if (method = 'doubleClick') 
  1044.         _DoubleClick();
  1045.  
  1046.     else if (method = 'optionDoubleClick')
  1047.     begin
  1048.         _PressKey({optionKey});
  1049.         _DoubleClick();
  1050.         _ReleaseKey({optionKey});
  1051.     end;
  1052.  
  1053.     else if (method = 'cmdO') 
  1054.         key_eq('o',1);
  1055.  
  1056.     else if (method = 'cmdOptionO') 
  1057.         key_eq('o',5);
  1058.  
  1059.     else if (method = 'cmdOptionZero') 
  1060.         key_eq('0',5);
  1061.  
  1062.     else if (method = 'cmdDown') 
  1063.         type_keys({'latch', commandKey, downArrowKey});
  1064.  
  1065.     else if (method = 'cmdOptionDown') 
  1066.         type_keys({'latch', commandKey, 'latch', optionKey, downArrowKey});
  1067.  
  1068.     else if (method = 'fileMenuOpen')
  1069.     begin
  1070.         if not select_menuItem('Open', 'File')
  1071.             return {"incomplete", "menuItem ∂'Open∂' not enabled for selected {targetFile}"};  
  1072.     end;
  1073.  
  1074.     else if (method = 'optionFileMenuOpen')
  1075.     begin
  1076.         _PressKey({optionKey});
  1077.         if not select_menuItem('Open', 'File')
  1078.             return {"incomplete", "menuItem ∂'Open∂' not enabled for selected {targetFile}"};  
  1079.         _ReleaseKey({optionKey});
  1080.     end;
  1081.  
  1082.     else if (method = 'appleMenu')        #NOTE this method does its own verification
  1083.     begin
  1084.         amnuPath := vuAid("FindFolder", {"amnu"});
  1085.         
  1086.         if not vuAid("move", {ctrlPath + ":" + targetItem, amnuPath})
  1087.             return {'incomplete',"Move to Apple Menu Items folder failed."};
  1088.         
  1089.         if not select_descriptor([menuitem t:targetFile m:[menu o:1]],5,6)
  1090.             return {'incomplete',"Selection of item in Apple Menu failed."};
  1091.  
  1092.         if not await_presence(itemDescriptor,,,,6) 
  1093.             tResult := {false, "{targetFile} did not open by {method}."};  
  1094.         else
  1095.             tResult := {true, "Verified open of {targetItem} by {method}."};
  1096.         key_eq("w");        # close before we move; not neccessary, only polite to the finder
  1097.         
  1098.         if not vuAid("move", {amnuPath + ":" + targetItem, ctrlPath})
  1099.             return {'incomplete','Item did not move back.'};
  1100.         return tResult;
  1101.     end;
  1102.  
  1103.     else # method is INVALID
  1104.         return {'incomplete','Invalid method ({method}) for open routine'};
  1105.         
  1106.     # Find the result of the test and print it out
  1107.     if not await_presence(itemDescriptor,,,,6) 
  1108.         return {false,"{targetItem} did not open by {method}."};  
  1109.     else
  1110.         tResult := {true, "open of {targetItem} by {method}"};
  1111.         
  1112.     if method ~= /≈ption≈/                # for option opens
  1113.     begin
  1114.         if not await_absence([window t:"Control Panels"]) 
  1115.             tResult := {false, "Control Panels window did not close by {method} behind {targetItem}."};
  1116.         else
  1117.             RAddResult("Verified: {itemWindow} closed correctly behind {targetItem}");
  1118.     end;
  1119.  
  1120.     return tResult;
  1121. end;
  1122.  
  1123.  
  1124. #########################################################################
  1125. #    task            _CloseBy(method, itemDescriptor, itemName)
  1126. #    Description:    Closes a CDEV by specified method.  This is a support
  1127. #                    task to CheckOpenCloseCDEV.
  1128. #    Parameters:        Discussed in CheckOpenCloseCDEV header
  1129. #    Returns:        true:    successful completion
  1130. #                    false:    if any test was incomplete or if given an
  1131. #                            invalid test case
  1132. #    History:
  1133. #        04/02/92    SBR        Created
  1134. #        11/17/93    JDL        Modified fileMenuClose option to select the
  1135. #                            'Close Window' menu item (there is no exact 
  1136. #                            match for a menu item 'Close'!)
  1137. #########################################################################
  1138. task    _CloseBy(method := 'invalid', itemDescriptor, itemName)
  1139. begin
  1140. ###                method is 'closeBox'
  1141.     if (method = 'closeBox')
  1142.     begin
  1143.         move_mouse({{15, 15}, 'click'});
  1144.     end;
  1145.  
  1146. ###                method is 'cmdW'
  1147.     else if (method = 'cmdW')
  1148.     begin
  1149.         key_eq('w');
  1150.     end;
  1151.  
  1152. ###                method is 'fileMenuClose'
  1153.     else if (method = 'fileMenuClose')
  1154.     begin
  1155.         if not select_menuItem('Close Window', 'File')
  1156.             return {"incomplete","menuItem ∂'Close Window∂' not enabled for {itemName}"};
  1157.     end;
  1158.  
  1159.  
  1160. ###                method is INVALID
  1161.     else 
  1162.         return {"incomplete",'Invalid method ({method}) for closing a control panel.'};
  1163.         
  1164.     if not await_absence(itemDescriptor,,,,6)
  1165.         return {false,"close {itemName} by {method}"};
  1166.         
  1167.     return {true, "close {itemName} by {method}"};         #if we managed to make it to this point, item was closed correctly
  1168. end;
  1169.  
  1170.  
  1171. #########################################################################
  1172. #    task            CleanUpByName()
  1173. #    Description:    Clean up Finder Window by small icon name
  1174. #    Parameters:        None
  1175. #    Returns:        true:    if successful completion
  1176. #                    false:    if error occurred
  1177. #    History:
  1178. #    04/02/92    SBR            Created
  1179. #    09/27/96    BRL/MSO        Added SPEC exception handling
  1180. #########################################################################
  1181. task CleanUpByName()
  1182. begin
  1183.     if not select_menuitem("by Small Icon", "View") return false;
  1184.     _PressKey({optionKey});
  1185.     select_menuitem(/Clean Up≈/, "Special");
  1186.     _ReleaseKey({optionKey});
  1187.     return true;
  1188. end;
  1189.  
  1190. #########################################################################
  1191. #    task            CheckOpenCloseCDEV(testType, itemDescriptor, testList, pathname)
  1192. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  1193. #    Description:    Engine to open and/or close CDEVs using a list of test cases
  1194. #                    (see also CheckOpenCloseDA, CheckOpenCloseFolder)
  1195. #    Parameters:        testType:    1 = QuickLook, 2 = Functional, 3 = Comprehensive
  1196. #                    itemDescriptor:    A complete descriptor of the item's window. The title, 
  1197. #                        style, and ordinal traits must be included, and the ordinal must 
  1198. #                        be set to 1. Of course, the more complete this is, the stricter 
  1199. #                        the test, so you can include the c:, z:, and g: traits. The 
  1200. #                        engine attempts exact matches unless noted. Do not include any 
  1201. #                        rectangle traits, because they are in global coordinates.
  1202. #                    testList: { test1, test2, ... testN };
  1203. #                        testN:    { testType, TCSID, action};
  1204. #                            testType:    1 = QuickLook, 2 = Functional, 3 = Comprehensive
  1205. #                            TCSID:     { Number (int), Set (str), Type (str), Owner (str) }
  1206. #                            action:        { actionType, method [,'alias']};
  1207. #                                actionType: 'Open' | 'Close' | 'all';
  1208. #                                            'Open': The methods of opening the CDEV.
  1209. #                                            'Close': The methods of closing the CDEV.
  1210. #                                            'all': Not yet implemented.
  1211. #                                method:    One of a selection, depending on the actionType.
  1212. #                                    actionType = 'Open'    (Open methods close the CDEV if it is not already closed.)
  1213. #                                        'doubleClick'    Double click the icon.
  1214. #                                        'optionDoubleClick'    Press option, double click the icon.
  1215. #                                                        Finder window will close.
  1216. #                                        'appleMenu'        Move the item to the Apple Menu Items sub-folder if 
  1217. #                                                        necessary and open it by selecting in the Apple Menu.
  1218. #                                        'cmdO'            Select icon and type command-O.
  1219. #                                        'cmdOptionO'    Select icon and type command-option-O.
  1220. #                                                        Finder window will close.
  1221. #                                        'cmdOptionZero'    Select icon and type command-option-Zero.
  1222. #                                                        Finder window will close.
  1223. #                                        'cmdDown'        Select icon and type command-down arrow.
  1224. #                                        'cmdOptionDown'    Select icon and type command-option-down arrow.
  1225. #                                                        Finder window will close.
  1226. #                                        'fileMenuOpen'        Select icon and choose 'Open' from File menu.
  1227. #                                        'optionFileMenuOpen'    Select, press option, choose 'Open' from File menu.
  1228. #                                                        Finder window will close.
  1229. #                                        'startupItem'    Move the item to the Startup Items sub-folder if 
  1230. #                                                        necessary and restart. NOT IMPLEMENTED YET!
  1231. #                                    actionType = 'Close'    (Close methods open the CDEV if it is not already open.)
  1232. #                                        'closeBox'        Click the item's close box.
  1233. #                                        'cmdW'            Select CDEV and type command-W.
  1234. #                                        'fileMenuClose'    Select CDEV and choose 'Close' from File menu.
  1235. #                                'alias':    If included, make an alias to the original if necessary and use the 
  1236. #                                            method(s) on the alias. If not included, use the method(s) on the 
  1237. #                                            original item. Ignored except with 'Open' actionType.
  1238. #                    pathname:    not yet implemented
  1239. #    Returns:        true:    successful completion of all test cases
  1240. #                    false:    if any test failed or if given an invalid test case
  1241. #    Examples:        testList:={
  1242. #                        {1, {1,'SampleCP','OpenClose','HLQ'}, {'open','doubleClick'}  },
  1243. #                        {1, {2,'SampleCP','OpenClose','HLQ'}, {'close','closeBox'} },
  1244. #                        {1, {3,'SampleCP','OpenClose','HLQ'}, {'close','fileMenuClose'} }
  1245. #                        {2, {4,'SampleCP','OpenClose','HLQ'}, {'open','doubleClick', 'alias'} },
  1246. #                    };
  1247. #                    CheckOpenCloseCDEV(TestType, testList, [window t:'Views' o:1 s:document
  1248. #                                            g:false z:false]);
  1249. #    Assumptions:    System 7 only.
  1250. #                    Names are not so long as to be truncated when aliased.
  1251. #                    All window names are unique.
  1252. #    Does NOT test:    whether title bars change state
  1253. #                    proper location, size or visual appearance of windows
  1254. #                    CDEVs which are not in the Control Panels folder
  1255. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  1256. #    History:
  1257. #    04/02/92    SBR            Created
  1258. #    06/21/94    SBR            Mods for TCS.lib
  1259. #    09/27/96    BRL/MSO        Added SPEC exception handling
  1260. #########################################################################
  1261. task    CheckOpenCloseCDEV(testType := 1, testList := {}, itemDescriptor, pathname := '')
  1262. begin
  1263.     itemName := itemDescriptor.t;
  1264.     prep := true;
  1265.     
  1266.     rOpenTest("Open and close tests for {itemName} control panel");
  1267.  
  1268.     rStatus('Initializing CheckOpenCloseCDEV.', 4);
  1269.     #SetDefaultViews(3);
  1270.     reset();
  1271.     if not await_presence([window t:'Desktop' o:1],,,,6) prep := false;
  1272.     
  1273.     #initPaths();
  1274.  
  1275.     itemWindow := 'Control Panels';        # the Finder window containing the item's icon
  1276.     if not open_control_panel() prep := false;
  1277.     if not CleanUpByName() prep := false;
  1278.  
  1279.     aliasIt := false;                    # this test needs an alias to work on
  1280.     global gAliasMade := false;            # if true, delete the alias at end of engine
  1281.     
  1282.     rStatus('Finished initializing CheckOpenCloseCDEV, starting testList.', 4);
  1283.     
  1284. ###        testN := { testType, action };
  1285.     if prep begin
  1286.         for each test in testList
  1287.         begin
  1288.             if test[1] <= testType
  1289.             begin
  1290.                 tResult := {};
  1291.                 TCSID := test[2];
  1292.                 action := test[3];
  1293.                 actionType := action[1];
  1294.                 method := action[2];
  1295.                 
  1296.                 if isMember('alias', action)                 # test an alias to the test file
  1297.                 begin
  1298.                     rStatus('Request for an alias.', 4);
  1299.                     targetFile := itemName + ' alias';
  1300.                     aliasIt := true; 
  1301.                 end;
  1302.                 else begin                                     # test the original file
  1303.                     targetFile := itemName;
  1304.                     aliasIt := false;
  1305.                 end;
  1306.     
  1307.                 rStatus("Attempting to {actionType} {targetFile} by {method}.", 4);
  1308.                 
  1309.                 if aliasIt
  1310.                     TCSDescriptionStr := "{actionType} a control panel alias by {method}";
  1311.                 else 
  1312.                     TCSDescriptionStr := "{actionType} a control panel by {method}";
  1313.                 TCSResultCode := 0;
  1314.                 TCSString := '';
  1315.                 TCSErrStr := '';
  1316.                 TCSStart(TCSID, TCSDescriptionStr);
  1317.     
  1318.     #####    actionType is OPEN
  1319.                 if (actionType = 'open')
  1320.                 begin
  1321.     ###                Open methods close the CDEV if it's already open
  1322.                     if _MatchBoolean([window t:itemName])
  1323.                     begin
  1324.                         select_window(itemName);
  1325.                         key_eq('w');
  1326.                         if not await_absence([window t:itemName],,,,6)
  1327.                         begin
  1328.                             errorString := "{itemName} would not close when preparing for open test";
  1329.                             tResult := {"incomplete",errorString};
  1330.                         end;
  1331.                         else
  1332.                             rStatus("{itemName} was already open. Closed it.", 4);
  1333.                     end;
  1334.                     
  1335.                     if tResult = {} 
  1336.                         tResult:= _OpenBy( method, itemDescriptor, itemWindow, itemName, targetFile, 
  1337.                                             aliasIt );
  1338.                 end;            
  1339.     
  1340.     #####    actionType is CLOSE
  1341.                 else if (actionType = 'close')
  1342.                 begin
  1343.     ###                Close methods open the CDEV if it is already closed.
  1344.                     if not _MatchBoolean([window t:itemName o:1])
  1345.                         if not open_control_panel(itemName) 
  1346.                         begin
  1347.                             errorString := "{itemName} did not open when preparing for close test.";
  1348.                             tResult := {"incomplete",errorString};
  1349.                         end;
  1350.                         
  1351.                     if tResult = {}
  1352.                         tResult := _CloseBy(method, itemDescriptor, itemName);
  1353.                 end;
  1354.                 
  1355.     #####    actionType is INVALID
  1356.                 else 
  1357.                     tResult := {"incomplete", 'Invalid actionType, skipping this test case.'};
  1358.             
  1359.     #####    check and log result
  1360.                 if tResult = {}
  1361.                 begin
  1362.                     tResult := {"incomplete", "No result was found for test - please contact the scripter"};        
  1363.                     TCSResultCode := -1;
  1364.                     TCSErrStr := tResult[2];
  1365.                 end;
  1366.                 else if (tResult[1] = 'pass') or (tResult[1] = true)
  1367.                 begin
  1368.                     TCSResultCode := 1;
  1369.                     TCSErrStr := '';
  1370.                 end;
  1371.                 else if (tResult[1] = 'fail') or (tResult[1] = false)
  1372.                 begin
  1373.                     TCSResultCode := 0;
  1374.                     TCSErrStr := tResult[2];
  1375.                 end;
  1376.                 else if tResult[1] = 'incomplete'
  1377.                 begin
  1378.                     TCSResultCode := -1;
  1379.                     TCSErrStr := tResult[2];
  1380.                 end;
  1381.                 
  1382.                 ###    Report to Phoenix
  1383.                 #println "TCSEnd(    {TCSID}, {TCSResultCode}, {TCSErrStr} )";
  1384.                 TCSEnd(    TCSID, TCSResultCode, TCSErrStr );
  1385. #                TCSEnd(        pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := 0, 
  1386. #                            pTCSStr := '', pCommentStr := '', pExceptionFlag := '');
  1387. #                
  1388.                 rResult( tResult[1], tResult[2] );
  1389.                 tResult := {};    
  1390.             end;    # this test case
  1391.             
  1392.         end;        # for each test in testList
  1393.         
  1394.     end;            # if not prep
  1395.     else 
  1396.         rResult( "incomplete", "Initialization failed for CheckOpenCloseCDEV");
  1397.         
  1398.     # Engine finished executing normally. Begin cleanup.
  1399.     
  1400.     rStatus("CheckOpenCloseCDEV cleaning up after all test cases done.",4);
  1401.     if gAliasMade begin                        # Delete the alias if one exists
  1402.         aliasPath := VUAid("FindFolder", {"ctrl"}) + ":" + itemName + " alias";
  1403.         vuAid("delete", {aliasPath});
  1404.     end;
  1405.     
  1406.     key_eq('w',5,4);                        # close all the windows
  1407.     
  1408.     rCloseTest();
  1409. end;            # open_close_CDEV
  1410.  
  1411.                             
  1412. #########################################################################
  1413. #    task            CheckArea(testType, testList)
  1414. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  1415. #    Description:    Checks whether the text is there or not.
  1416. #    Parameters:        testList:=    {test1, test2, ... testN}
  1417. #                        testN: { testType, testName, testLoc{{areaCoor1}, {areaCoor2}}, state, '{expected}'}
  1418. #                            textCoor1 is the starting coordinates(x, y) relative to window
  1419. #                            textCoor2 is the ending coordinates(x, y)   relative to window
  1420. #                    testType:= 1,2,3 for QuickLook, Functional, Comprehensive
  1421. #                    invert is whether invertwindow is to be invoked. If true invertwindow 
  1422. #                        is called and if false, it is not.  Default is false.
  1423. #    Returns:        Nothing
  1424. #    Examples:        testList:= {
  1425. #                        { 1, "key repeat rate",    {{22, 29},{95, 38}}, {'5641', '10350', '19530', '41310'}}
  1426. #                    };
  1427. #                    CheckArea(1, testList);
  1428. #    Assumptions:    Window for which area is being checked should be open
  1429. #∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
  1430. #    History:
  1431. #    4/16/92        Al Allamsetty    Created
  1432. #    09/27/96    BRL/MSO        Added SPEC exception handling
  1433. #########################################################################
  1434. task    CheckArea(testType:= 1, testList:= {} , invert := false)
  1435. begin
  1436.     CurBitDepth := VUAid("GetDepth");
  1437.     
  1438.     rOpenTest("Area verification tests");
  1439.  
  1440.     if _MatchBoolean([window o:1]) 
  1441.     begin
  1442.         OffSetList := {"Color", "Date & Time", "Easy Access", "General Controls", "Keyboard",
  1443.                         "Labels", "Map", "Memory", "Monitors", "Mouse", "Numbers", "StartUp Disk",
  1444.                         "Sound", "Text"};
  1445.  
  1446.         for each test in testList 
  1447.         begin
  1448.             if test[1] <= testType 
  1449.             begin
  1450.                 testName := test[2];
  1451.                 testLoc  := test[3];
  1452.                 expected := WhichCheckSum(test[4], CurBitDepth);
  1453.                 areaCoor1 :=  testLoc[1];
  1454.                 areaCoor2 :=  testLoc[2];
  1455.                 
  1456.                 m1 := _Match([window o:1]);
  1457.                 if IsMember (m1.t, OffSetList) 
  1458.                 begin 
  1459.                     windc1 := areaCoor1[1] + 87;
  1460.                     windc3 := areaCoor2[1] + 87;
  1461.                 end;
  1462.                 else
  1463.                 begin
  1464.                     windc1 := areaCoor1[1] + 87 - 89;
  1465.                     windc3 := areaCoor2[1] + 87 - 89;
  1466.                 end;
  1467.                 windc2 :=  areaCoor1[2] - 18;
  1468.                 windc4 :=  areaCoor2[2] - 18;
  1469.  
  1470.                 if invert = true
  1471.                 begin 
  1472.                     VUAid("invertwindowRect", {windc1, windc2, windc3, windc4});
  1473.                     VUAid("invertwindowRect", {windc1, windc2, windc3, windc4});
  1474.                 end;
  1475.  
  1476.                 actual := VUAid("ComparewindowRect", {windc1, windc2, windc3, windc4}, 4);
  1477.                 if actual = expected
  1478.                     tResult := {true,"area exists for '{testName}'"};
  1479.                 else
  1480.                     tResult:= {false, "area not as expected for {testName}"};
  1481.                 
  1482.                 CAidedSE := {test, {4, "Comparewindow {windc1} {windc2} {windc3} {windc4}"}};    
  1483.                 rResult(tResult[1], tResult[2], expected, actual,,CAidedSE); 
  1484.             end;
  1485.         end;
  1486.     end;
  1487.     else
  1488.         rResult("incomplete", "Could not find an open window");
  1489.     rCloseTest();
  1490. end;
  1491.  
  1492. #    09/07/95 TCS format from SPEC 1.2 TCS.lib:
  1493. #    TCSStart(    pTCSId, pTextDesc, pAppName := global gAppTitle    );
  1494. #    TCSEnd(        pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := 0, pTCSStr := '', 
  1495. #                pCommentStr := '', pExceptionFlag := '');
  1496. (*
  1497.     try 
  1498.         match [window o:1 t:"Views" r:?wRect]!;
  1499.     catch theError
  1500.         ExceptionDispatcher(theError,,{"match in CheckArea", {testType, testList, invert}});
  1501. *)